package org.jivesoftware.smackx.search;

import org.jivesoftware.smack.Connection;
import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smackx.Form;
import org.jivesoftware.smackx.ReportedData;

public class UserSearchManager
{
  private Connection con;
  private UserSearch userSearch;

  public UserSearchManager(Connection paramConnection)
  {
    this.con = paramConnection;
    this.userSearch = new UserSearch();
  }

  public Form getSearchForm(String paramString)
    throws XMPPException
  {
    return this.userSearch.getSearchForm(this.con, paramString);
  }

  public ReportedData getSearchResults(Form paramForm, String paramString)
    throws XMPPException
  {
    return this.userSearch.sendSearchForm(this.con, paramForm, paramString);
  }

  // ERROR //
  public java.util.Collection getSearchServices()
    throws XMPPException
  {
    // Byte code:
    //   0: new 39	java/util/ArrayList
    //   3: dup
    //   4: invokespecial 40	java/util/ArrayList:<init>	()V
    //   7: astore_1
    //   8: aload_0
    //   9: getfield 15	org/jivesoftware/smackx/search/UserSearchManager:con	Lorg/jivesoftware/smack/Connection;
    //   12: invokestatic 46	org/jivesoftware/smackx/ServiceDiscoveryManager:getInstanceFor	(Lorg/jivesoftware/smack/Connection;)Lorg/jivesoftware/smackx/ServiceDiscoveryManager;
    //   15: astore_2
    //   16: aload_2
    //   17: aload_0
    //   18: getfield 15	org/jivesoftware/smackx/search/UserSearchManager:con	Lorg/jivesoftware/smack/Connection;
    //   21: invokevirtual 52	org/jivesoftware/smack/Connection:getServiceName	()Ljava/lang/String;
    //   24: invokevirtual 56	org/jivesoftware/smackx/ServiceDiscoveryManager:discoverItems	(Ljava/lang/String;)Lorg/jivesoftware/smackx/packet/DiscoverItems;
    //   27: invokevirtual 62	org/jivesoftware/smackx/packet/DiscoverItems:getItems	()Ljava/util/Iterator;
    //   30: astore_3
    //   31: aload_3
    //   32: invokeinterface 68 1 0
    //   37: ifne +5 -> 42
    //   40: aload_1
    //   41: areturn
    //   42: aload_3
    //   43: invokeinterface 72 1 0
    //   48: checkcast 74	org/jivesoftware/smackx/packet/DiscoverItems$Item
    //   51: astore 4
    //   53: aload_2
    //   54: aload 4
    //   56: invokevirtual 77	org/jivesoftware/smackx/packet/DiscoverItems$Item:getEntityID	()Ljava/lang/String;
    //   59: invokevirtual 81	org/jivesoftware/smackx/ServiceDiscoveryManager:discoverInfo	(Ljava/lang/String;)Lorg/jivesoftware/smackx/packet/DiscoverInfo;
    //   62: astore 7
    //   64: aload 7
    //   66: ldc 83
    //   68: invokevirtual 89	org/jivesoftware/smackx/packet/DiscoverInfo:containsFeature	(Ljava/lang/String;)Z
    //   71: ifeq -40 -> 31
    //   74: aload_1
    //   75: aload 4
    //   77: invokevirtual 77	org/jivesoftware/smackx/packet/DiscoverItems$Item:getEntityID	()Ljava/lang/String;
    //   80: invokeinterface 95 2 0
    //   85: pop
    //   86: goto -55 -> 31
    //   89: astore 6
    //   91: goto -51 -> 40
    //   94: astore 5
    //   96: goto -65 -> 31
    //
    // Exception table:
    //   from	to	target	type
    //   53	64	89	java/lang/Exception
    //   64	86	89	java/lang/Exception
    //   53	64	94	XMPPException
  }
}